package cn.sunxyz.enums;

/**
 * Created by yangrd on 2017/5/24.
 */
public enum Size {
    SMALL(() -> System.out.println("小号")) {
        @Override
        public ISize size() {
            return this.iSize;
        }
    }, MEDIUM(() -> System.out.println("中号")) {
        @Override
        public ISize size() {
            return this.iSize;
        }
    }, LARGE(new SizeImpl()) {
        @Override
        public ISize size() {
            return this.iSize;
        }
    };
    ISize iSize;

    Size(ISize iSize) {
        this.iSize = iSize;
    }

    public abstract ISize size();

    public ISize getiSize() {
        return this.iSize;
    }

}
